*** Keywords ***
Is Exist In List
    [Arguments]    ${lst}    ${val}
    [Documentation]    是否存在列表中
    ${isExist}=    Get Index From List    ${lst}    ${val}
    [Teardown]
    [Return]    ${isExist}

Del In List By Value
    [Arguments]    ${lst}    ${val}
    [Documentation]    是否存在列表中
    ${isExist}=    Get Index From List    ${lst}    ${val}
    Run Keyword if    ${isExist}!= -1    Remove From List    ${lst}    ${isExist}
    [Teardown]
    [Return]    ${lst}

Del In List By Index
    [Arguments]    ${lst}    ${val}
    [Documentation]    是否存在列表中
    ${isExist}=    Get Index From List    ${lst}    ${val}
    Run Keyword if    ${isExist}!= -1    Remove From List    ${lst}    ${isExist}
    [Teardown]
    [Return]    ${lst}

Insert In List By Value
    [Arguments]    ${lst}    ${value}    ${nval}
    [Documentation]    是否存在列表中
    ${isExist}=    Get Index From List    ${lst}    ${value}
    Run Keyword if    ${isExist}!= -1    Insert into List    ${lst}    ${isExist}    ${nval}
    ...    ELSE    Append To List    ${lst}    ${nval}
    [Teardown]
    [Return]    ${lst}

Insert In List By Index
    [Arguments]    ${lst}    ${index}    ${val}
    [Documentation]    是否存在列表中
    ${len}=    Get Length    ${lst}
    Run Keyword if    ${len} > ${index} and ${index} >= 0    Insert into List    ${lst}    ${index}    ${val}
    ...    ELSE    Append To List    ${lst}    ${val}
    [Teardown]
    [Return]    ${lst}
